//
//  UILabel+Typesetting.h
//  TravelGuideMdd
//
//  Created by Song Xiaofeng on 13-6-7.
//  Copyright (c) 2013年 mafengwo.com. All rights reserved.
//

#import <UIKit/UIKit.h>

#define UNLIMITED   CGFLOAT_MAX
@interface UILabel (Typesetting)

/**
   调用该函数前确保已经设置了textFont和text
   1. sizeToFit
   2. will use (startAnchor, size) to self's frame
   3. before set frame compute new frame whether exceed limitedAnchor.
      newFrame.orgin.x + newFrame.size.width < limitedAnchor.x
      newFrame.orgin.y + newFrame.size.height < limitedAnchor.y
 
  @return - the frame that seted finally
 */
- (CGRect)autoLayoutAt:(CGPoint)startAnchor limitedAnchor:(CGPoint)limitedAnchor;

- (CGRect)autoLayoutAtStartX:(CGFloat)starX startY:(CGFloat)startY limitedX:(CGFloat)limtX limitedY:(CGFloat)limtY;

- (CGRect)autoLayoutAtStartX:(CGFloat)starX startY:(CGFloat)startY limitedX:(CGFloat)limtX;

- (CGRect)autoLayoutAtStartX:(CGFloat)starX startY:(CGFloat)startY limitedY:(CGFloat)limtY;

- (CGRect)autoLayoutAtStartX:(CGFloat)starX startY:(CGFloat)startY;

// @see - (CGRect)autoLayoutAt:(CGPoint)startAnchor limitedAnchor:(CGPoint)limitedAnchor;
// limitedAnchor will set to (CGFLOAT_MAX, CGFLOAT_MAX), that's having no limitation
- (CGRect)autoLayoutAt:(CGPoint)startAnchor;
@end
